//
//  ShowImage.m
//  7.13苏宁框架
//
//  Created by lovena on 15/7/18.
//  Copyright (c) 2015年 lovena. All rights reserved.
//

#import "ShowImage.h"
#import "Common.h"

@implementation ShowImage
//购买测试
- (IBAction)buyedBtn {
    
    ShopModel *shopmodel=[[ShopModel alloc]init];
    shopmodel.icon=_model.icon;
    shopmodel.name=_model.name;
    shopmodel.count=1;
    shopmodel.price=_model.price;
    shopmodel.oldprice=@"0";
    shopmodel.type=@"团购";
    shopmodel.flag=YES;
    
    if([self.delegate respondsToSelector:@selector(addBuys:)])
    {
        [self.delegate addBuys:shopmodel];
    }
    //NSLog(@"成功");
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    _btn.layer.cornerRadius=3;
    _btn.layer.masksToBounds=YES;
}
+(id)showImage
{
    return [[[NSBundle mainBundle]loadNibNamed:@"ShowImage" owner:nil options:nil] lastObject];
}
-(void)setModel:(ShowScrollModel *)model
{
    _model=model;
    //图片
    [self.showImageView setImageWithURL:[NSURL URLWithString:model.icon]];

    //名字
    self.nameLabel.text=model.name;
    
    //价钱
    self.priceLabel.text=[NSString stringWithFormat:@"¥%@",model.price];
    self.url=model.url;
    
}
@end
